<?php 

	$binTable = new Application_Model_Bins();

	if (is_object($this->valuation)) 

	{

		$this->valuation = $this->valuation->toArray(); 

		$myrow = $binTable->fetchRow( $binTable->select()->where('card_bin=?', substr($this->valuation['voucher'], 0, 6)) );

		if ($myrow) {

			$this->valuation['card_type'] = $myrow->card_type;

			$this->valuation['card_level'] = $myrow->card_level;

			$this->valuation['card_bank'] = $myrow->card_bank;

			$this->valuation['card_country'] = $myrow->card_country;

		}

	}

	setlocale(LC_MONETARY, 'en_US');

	#$this->valuation['price'] = money_format('%.2n', $this->valuation['price']);
	$this->valuation['price'] = $this->valuation['price'];

?>

<tr class="car-row-<?= $this->valuation['id'] ?>">

  <td><span style='border-bottom: 1px dashed #0088cc;'>

    <? if ($this->hideVoucher): ?>

      <?= trim(substr($this->valuation['voucher'], 0, 6)) ?>

	<? else: ?>

	  <?= $this->valuation['voucher'] ?>

    <? endif; ?>

		</span>

  </td>

  <td> <?= date('my', strtotime($this->valuation['exp_date'])) ?> </td>

  <td> <?= $this->valuation['name'] ?> </td>

  <td> <?= $this->valuation['card_country'] ?> </td>

  <td> <?= $this->valuation['city'] ?> </td>

  <td> <?= $this->valuation['zip'] ?> </td>

  <td> <?= $this->valuation['card_type'] ?> </td>

  <td style='color:red;'> <?= $this->valuation['card_level'] ?> </td>

  <td> <?= $this->valuation['card_bank'] ?> </td>

  <td> <?= $this->valuation['price'] ?> </td>

  <td nowrap>

		<? if (!$this->skipButtons || is_array($this->skipButtons)): ?>

		  <? if (!(is_array($this->skipButtons) && $this->skipButtons['buy_now'])): ?>

		    <a href="/cart/browse?add=<?= $this->valuation['id'] ?>" class="btn btn-info btn-mini">Buy now <i class="icon-white icon-download"></i></a>

		  <? endif; ?>

		  <? if (!(is_array($this->skipButtons) && $this->skipButtons['add_to_cart'])): ?>

		    <button vID="<?= $this->valuation['id'] ?>" class="btn btn-info btn-mini add-to-cart-<?= $this->valuation['id'] ?> add-to-cart">Add To Cart <i class="icon-white icon-shopping-cart"></i></button>

		  <? endif; ?>

		  <? if (!(is_array($this->skipButtons) && $this->skipButtons['save'])): ?>

		    <button vID="<?= $this->valuation['id'] ?>" class="btn btn-info btn-mini save-car-<?= $this->valuation['id'] ?> save-car">Save <i class="icon-white icon-star"></i></button>

		  <? endif; ?>

		<? endif; ?>

		  <? if ($this->canViewDetails): ?>

		    <a href="/cars/entry?id=<?= $this->valuation['id'] ?>" class="btn btn-mini">View full details</a>

		  <? endif; ?>

  </td>

</tr>

<?

/*

<tr class="car-row-<?= $this->valuation->id ?>">



<? if (!$this->skipImage): ?>

	<td class="disp-simple-img">

	  <? if ($this->valuation->file_name1 && file_exists(CAR_IMG_DIRECTORY.$this->valuation->file_name1) ): ?>

	    <span style="margin:0px;position:absolute;" class="label label-info">User image</span>

	  <? else: ?>

	    <span style="margin:0px;position:absolute;" class="label label-info">Not actual image</span>

	  <? endif; ?>

	  <img alt="<?= $this->valuation->model ?>" src="/cars/get-image?file=<?=$this->valuation->file_name1 ?>&capid=<?= $this->valuation->CAPID ?>">

	</td>

<? endif; ?>

	<td class="disp-simple-content">

	  <? if (!(is_array($this->skipButtons) && $this->skipButtons['delete'])): ?>

	    <button style="float:right; margin-left:10px;" class="btn btn-danger btn-small" onClick="_BROWSE.deleteCar(<?= $this->valuation->id ?>, 'slide');">Delete <i class="icon-white icon-trash"></i></button>

	  <? endif; ?>

	  <a href="#" style="float:right;margin-left:10px;" class="btn btn-warning btn-small"><i class="icon-white icon-briefcase"></i> &pound;<?= number_format($this->valuation->getCost(), 0) ?></a>

	  <a href="#" style="float:right;" class="btn btn-success btn-small"><i class="icon-white icon-tag"></i> &pound;<?= number_format($this->valuation->cost_retail, 0) ?></a>

	    <strong ><?= $this->valuation->manufacturer ?></strong>

		<span class="car-model"><?= $this->valuation->model ?>

		 <?= $this->valuation->derivative; ?>

		 <?= $this->valuation->transmission; ?>

		 <?= $this->valuation->fueltype; ?>

		 <?= $this->valuation->plate; ?>

		 Mileage: <?= number_format($this->valuation->mileage, 0, " ", " "); ?><br>

	   </span><br>

	  <p class="selling-points">

	    <?= htmlentities(substr($this->valuation->major_selling_points, 0, 160) ) ?>

	  </p>

	  <p>

		<? if (!$this->skipButtons || is_array($this->skipButtons)): ?>

		  <? if (!(is_array($this->skipButtons) && $this->skipButtons['buy_now'])): ?>

		    <a href="/cart/browse?add=<?= $this->valuation->id ?>" class="btn btn-info btn-mini">Buy now <i class="icon-white icon-download"></i></a>

		  <? endif; ?>

		  <? if (!(is_array($this->skipButtons) && $this->skipButtons['add_to_cart'])): ?>

		    <button vID="<?= $this->valuation->id ?>" class="btn btn-info btn-mini add-to-cart-<?= $this->valuation->id ?> add-to-cart">Add To Cart <i class="icon-white icon-shopping-cart"></i></button>

		  <? endif; ?>

		  <? if (!(is_array($this->skipButtons) && $this->skipButtons['save'])): ?>

		    <button vID="<?= $this->valuation->id ?>" class="btn btn-info btn-mini save-car-<?= $this->valuation->id ?> save-car">Save <i class="icon-white icon-star"></i></button>

		  <? endif; ?>

		<? endif; ?>

		  <? if ($this->canViewDetails): ?>

		    <a href="/cars/entry?id=<?= $this->valuation->id ?>" class="btn btn-mini">View full details</a>

		  <? endif; ?>

	  </p>

	</td>

</tr>

*/
